package com.example.demo.basic;

import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Component;

/**
 * @ClassName ScConsumer
 * @Description 接收消息
 * @Author zhangdachen
 * @Date 2021-09-15 13:47
 * @Version V1.0
 **/
@Component
public class ScConsumer {

    @StreamListener(value = Sink.INPUT)
    public void onMessage(String message){
        System.out.println("接收到消息："+message);
    }
}
